<!--
 * @Author      : ZhouQiJun
 * @Date        : 2025-06-03 15:10:58
 * @LastEditors : ZhouQiJun
 * @LastEditTime: 2025-06-03 20:42:42
 * @Description : 首页
-->
<script setup lang="ts">
import TodoAdd from '../components/TodoAdd.vue'
import { useTodoListStore, type Todo } from '@/stores/useTodoListStore'
import TodoList from '@/components/TodoList.vue'

const todoListStore = useTodoListStore()

function onAdd(todo: Todo) {
  todoListStore.addTodo(todo)
}
</script>

<template>
  <main class="flex flex-col items-center">
    <div class="mb-2">
      <TodoAdd @add="onAdd" />
    </div>
    <TodoList :list="todoListStore.todoList" />
  </main>
</template>
